//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package javax.vpncrypto;

import java.io.Serializable;
import java.security.Permission;
import java.security.PermissionCollection;
import java.util.Enumeration;
import java.util.Vector;

final class CryptoAllPermissionCollection extends PermissionCollection implements Serializable {
    private static final long serialVersionUID = 7450076868380144072L;
    private boolean all_allowed = false;

    CryptoAllPermissionCollection() {
    }

    public void add(Permission var1) {
        if (this.isReadOnly()) {
            throw new SecurityException("attempt to add a Permission to a readonly PermissionCollection");
        } else if (var1 == javax.vpncrypto.CryptoAllPermission.INSTANCE) {
            this.all_allowed = true;
        }
    }

    public boolean implies(Permission var1) {
        return !(var1 instanceof javax.vpncrypto.CryptoPermission) ? false : this.all_allowed;
    }

    public Enumeration<Permission> elements() {
        Vector var1 = new Vector(1);
        if (this.all_allowed) {
            var1.add(javax.vpncrypto.CryptoAllPermission.INSTANCE);
        }

        return var1.elements();
    }
}
